import type { Router } from 'vue-router'
import { appConfig } from '@/config'
import { useUserStore } from '@/store'

export const useHasMenu = (router: Router) => {
  const userStore = useUserStore()
  router.beforeEach((to) => {
    return
    if (!(to.meta.needToken ?? appConfig.defaultRouteMeta.needToken)) {
      return
    }
    const menu = userStore.navigationMenuMap.get(to.path)
    if (menu === undefined) {
      return {
        name: 'Error404'
      }
    }
  })
}
